package siac.com.entity;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the fac_lote_atendimento database table.
 * 
 */
@Embeddable
public class FacLoteAtendimentoPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	
    @JoinColumn(name = "idLote", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false) //, fetch = FetchType.EAGER
	private FacLote lote = new FacLote();
    @JoinColumn(name = "idAtendimento", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false) //, fetch = FetchType.EAGER
	private FacAtendimento atendimento = new FacAtendimento();

    public FacLoteAtendimentoPK() {
    }

	public FacLote getLote() {
		return lote;
	}

	public void setLote(FacLote lote) {
		this.lote = lote;
	}

	public FacAtendimento getAtendimento() {
		return atendimento;
	}

	public void setAtendimento(FacAtendimento atendimento) {
		this.atendimento = atendimento;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((atendimento == null) ? 0 : atendimento.hashCode());
		result = prime * result + ((lote == null) ? 0 : lote.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		FacLoteAtendimentoPK other = (FacLoteAtendimentoPK) obj;
		if (atendimento == null) {
			if (other.atendimento != null)
				return false;
		} else if (!atendimento.equals(other.atendimento))
			return false;
		if (lote == null) {
			if (other.lote != null)
				return false;
		} else if (!lote.equals(other.lote))
			return false;
		return true;
	}
    
    
}